<?php if(!defined('WANYA_ROOT')) {exit('error!');}?>
<script language="javascript" type="text/javascript" src="editor/My97DatePicker/WdatePicker.js"></script>
<div class=containertitle><b>课程-上课时间安排</b>
<?php if(isset($_GET['active_update'])):?><span class="actived">课时安排成功</span><?php endif;?>
</div>
<div class=line></div>
<form action="lesson_arrange.php" method="post" name="form_la" id="form_la">
	<fieldset style="border:2px solid #0099ff;">
		<legend>课程信息</legend>
	<table style="margin-bottom: 5px;margin-left: 10px">
		<tr>
			<td>课程：</td>
			<td>
				<input type="text" disabled="disabled" name="course_name" id="course_name" value="<?php echo($courseDetail["course_name"]);?>">　
			</td>
			<td>批次：</td>
			<td>
				<input type="text" disabled="disabled" name="course_batch_show"  value="<?php echo($courseBatch);?>">　
			</td>
		</tr>
	</table>
		</fieldset>
<br>
  <table width="100%" id="adm_comment_list" class="item_list">
	  <caption align="top">上课时间安排</caption>
  	<thead>
      <tr>
		<th width="50" style="text-align: center"><b>节次</b></th>
        <th width="150" colspan="1"><b>上课时间</b></th>
		<th width="550"><b>备考（可输入上课老师）</b></th>
		  <th width="200" style="text-align: center"><b>操作</b></th>
      </tr>
    </thead>
    <tbody>
	<?php
	if($lessons):
	foreach($lessons as $key=>$value):
	?>
     <tr>
		<td style="text-align: center"><?php echo $value['lesson_num']; ?></td>
		<td><input class="Wdate" type="text" name="lesson_time<?php echo $value['lesson_num']; ?>" value="<?php echo($value["lesson_time"]);?>" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})"></td>
		<td><input maxlength="100" style="width:400px;"  name="comment<?php echo $value['lesson_num']; ?>"value="<?php echo($value["comment"]);?>"></td>
		<td style="text-align: center"><input type="button" value="作业/评语管理" onclick="homeWorkReviewEdit(<?php echo($courseDetail['ID']);?>,<?php echo($courseBatch);?>,<?php echo $value['lesson_num']; ?>)"/></td>
	</tr>
	<?php endforeach;else:?>
	  <tr><td class="tdcenter" colspan="3">还没有任何课时。</td></tr>
	<?php endif;?>
	</tbody>
  </table>

	<table width="100%" border="2px">
		<tr>
			<td style="text-align: center" width="2"><br>
				<input type="button" name="cancel" value="取消" onclick="formCancel()" class="button">　　　　　
				<input type="submit" name="confirm" value="确认" class="button"></td>
			<td style="text-align: right;" valign="top" width="1">(共有<?php echo count($lessons); ?>节课)</td>
		</tr>
	</table>

	<input type="hidden" name="courseID" id="courseID" value="<?php echo($courseDetail["ID"]);?>" >
	<input type="hidden" name="courseBatch" id="courseBatch" value="<?php echo($courseBatch);?>" >
	<input type="hidden" name="lessonNum" id="lessonNum">
	<input type="hidden" name="lessonCount" id="count" value="<?php echo count($lessons); ?>" >
	<input type="hidden" name="action" id="action" value="commit" >
</form>

<script>
	function homeWorkReviewEdit(courseID,courseBatch,lessonNum){
		$("#courseID").val(courseID);
		$("#courseBatch").val(courseBatch);
		$("#lessonNum").val(lessonNum);
		$("#action").val("homeWorkReviewEdit");
		$("#form_la").submit();
	}

	function formCancel(){
		history.go(-1);
	}

$(document).ready(function(){

	$("#adm_comment_list tbody tr:odd").addClass("tralt_b");
	$("#adm_comment_list tbody tr")
		.mouseover(function(){$(this).addClass("trover");$(this).find("span").show();})
		.mouseout(function(){$(this).removeClass("trover");$(this).find("span").hide();})
});
setTimeout(hideActived,2600);
$("#menu_cm").addClass('sidebarsubmenu1');
</script>